<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Ace Armor</title>
<link rel="stylesheet" href="views/css/datatable/demo_page.css" type="text/css" media="screen" title="default" />
<link rel="stylesheet" href="views/css/datatable/demo_table_jui.css" type="text/css" media="screen" title="default" />
<link rel="stylesheet" href="views/css/smoothness/jquery-ui-1.8.23.custom.css" type="text/css" media="screen" title="default" />
<script type="text/javascript" charset="utf-8" src="views/js/jquery/jquery-ui-1.8.23.custom.min.js"></script>
<script src="views/js/jquery/jquery.selectbox-0.5.js" type="text/javascript"></script>
<script src="views/js/mesh.js" type="text/javascript"></script>
<script>
$(function() {
	$( "input:submit", ".demo" ).button();
	
});
function newEdit(){
	if($("#RePassword").val()!=$("#password").val()){
		alert("Password mismatch");
		return false;
		}
		if( $('#idVal').html()=="New"){
			$('#id').remove();
			}
		$("#UserRegPage").submit();
		}
		

$(document).ready(function(){
$("#RePassword").val($("#password").val());
});
</script>
</head>
<body>
<div class="iframe">
<s:actionerror />
<s:form method="post" theme="simple" id="UserRegPage" action="AddUserRegAction">
<div id="login-holder ">
	<table border="0" width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td>
		<div id="faded2" class="demo">
		<s:hidden name="user.id" id="id"></s:hidden>
		<s:hidden name="user.creationDate" id="id"></s:hidden>
		<s:hidden name="user.updationDate" id="id"></s:hidden>
		<s:hidden name="crudType" id="id"></s:hidden>
		<span class="hide_" id="idVal"><s:property value="crudType" ></s:property></span>
		<table class="floatRight center">
			<tr>
				<th valign="middle" align="right">Login ID : &nbsp;</th>
				<td><s:textfield id="loginId" name="user.loginId"
					cssClass="inp-form" required="true" /></td>
			</tr>
			<tr>
				<th valign="middle" align="right">Password : &nbsp;</th>
				<td><s:password id="password" name="user.password" showPassword="true"
					cssClass="inp-form" required="true" /></td>
			</tr>
			<tr>
				<th valign="middle" align="right">Re-enter Password : &nbsp;</th>
				<td><s:password id="RePassword"  showPassword="true"
					cssClass="inp-form" required="true" /></td>
			</tr><!--
			<tr>
				<th valign="middle" align="right">Employee Id : &nbsp;</th>
				<td><s:textfield id="model" name="user.employee.employeeId"
					cssClass="inp-form" required="true" /></td>
			</tr>
			--><tr>
				<th valign="middle" align="right">Role : &nbsp;</th>
				<td>
				<s:select list="roleList"	headerValue="--Select" headerKey="-1" listKey="code" name="user.role.id"
				 listValue="value" cssClass="styledselect_form_1" labelSeparator=" :"></s:select>  
				</td>
			</tr>
			<tr>
				<th valign="middle" align="right">Status : &nbsp;</th>
				<td>
				<s:select list="statusList"	headerValue="--Select" headerKey="-1" listKey="code" name="user.status"
				 listValue="value" cssClass="styledselect_form_1" labelSeparator=" :"></s:select>  
				</td>
			</tr>
			<tr>
				<td class="pad50px">
				<input type="button" id="submit" class="ui-button ui-widget ui-state-default ui-corner-all" 
				value="Submit" onclick="newEdit();" ></input>
				</td>
			</tr>
		</table>
		</div>
		</td>

	</tr>
</table>
</div>
</s:form>
</div>
</body>
</html>